function httpRequest(url, data) {

	return new Promise((resolve, reject)=>{
		
		uni.request({
			url: url,
			data: data || {},
			method: "POST",
			header: {
				
			},
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		});
		
		
		
	})

}

const request = (url, data, method) => {

	return new Promise((resolve, reject)=>{
		
		uni.request({
			url: url,
			data: data || {},
			method: method || "POST",
			header: {
				// "token": "",
				// "content-type": "application/json"
			},
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		});
		
	})

}


export default {
	request,
	httpRequest
}